package com.iplant.basic.service.po.fmc;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.iplant.base.po.BasePO;
import com.iplant.base.utils.annotation.po.DBBasePO;
import com.iplant.base.utils.annotation.condition.DBCondition;
import com.iplant.base.utils.annotation.field.DBField;
import com.iplant.base.utils.annotation.join.DBJoin;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;


@DBBasePO(TableName = "fmc_station", CheckName = {"Code", "WorkAreaID,Name"}, CodeAuto = true, CodePrefix = "GW-",
        Cache = true)
public class FMCStation extends BasePO implements Serializable {
    private static final long serialVersionUID = 1L;

    @DBField
    public String WorkName = "";
    @DBField
    public String Icon = "";

    @DBCondition
    @DBField
    public int WorkAreaID = 0;
    @DBCondition(CompareType = DBCondition.DBCompareType.like)
    @DBJoin(name = "Name", tableName = "fmc_workarea", tableAsName = "w2", MainTableField = "WorkAreaID")
    public String WorkAreaName = "";

    @DBJoin(name = "Code", tableName = "fmc_workarea", tableAsName = "w2", MainTableField = "WorkAreaID")
    public String WorkAreaCode = "";


    @DBCondition
    @DBJoin(name = "WorkshopID", tableName = "fmc_workarea", tableAsName = "w2", MainTableField = "WorkAreaID")
    public int WorkshopID = 0;
    @DBJoin(name = "Name", tableName = "fmc_workshop", tableAsName = "w1", JoinIndex = 2, ConditionalJoin = "w2" +
            ".WorkshopID=w1.ID")
    public String WorkshopName = "";
    @DBJoin(name = "Code", tableName = "fmc_workshop", tableAsName = "w1", JoinIndex = 2, ConditionalJoin = "w2" +
            ".WorkshopID=w1.ID")
    public String WorkshopCode = "";

    @DBJoin(name = "FactoryID", tableName = "fmc_workshop", tableAsName = "w1", JoinIndex = 2, ConditionalJoin = "w2" +
            ".WorkshopID=w1.ID")
    public int FactoryID = 0;

    @DBJoin(name = "Code", tableName = "fmc_factory", tableAsName = "f1", JoinIndex = 3, ConditionalJoin = {"w1" +
            ".FactoryID=f1.ID"})
    public String FactoryCode = "";

    @DBJoin(name = "Name", tableName = "fmc_factory", tableAsName = "f1", JoinIndex = 3, ConditionalJoin = "w1" +
            ".FactoryID=f1.ID")
    public String FactoryName = "";

    @DBCondition(CompareType = DBCondition.DBCompareType.findInSet)
    @DBField
    public List<Integer> DeviceID = new ArrayList<Integer>();

    /**
     * 设备名称 需要自行翻译
     */
    public String DeviceName = "";
    /**
     * 设备编号  需要自行翻译
     */
    public String DeviceCode = "";

    @DBField
    public List<Integer> StoreID = new ArrayList<Integer>();

    public String StoreName = "";
    public String StoreCode = "";

    @DBField(Insert = false, ValueAuto = true)
    public int SequenceNo = 0;

    /**
     * 检验类型
     */
    @DBCondition
    @DBField
    public int CheckType = 0;

    public List<FMCResource> ResourceList = new ArrayList<FMCResource>();

    /**
     * 功能清单（枚举，前端自定义）
     */
    @DBCondition(CompareType = DBCondition.DBCompareType.findInSet)
    @DBField
    public List<Integer> FunctionEnumList = new ArrayList<>();
    /**
     * 工位状态（0默认 1报警）
     */
    @DBCondition
    @DBField
    public int Status = 0;
    /**
     * 报警文本
     */
    @DBField
    public String AlarmText = "";

    /**
     * 条码类型
     */
    @DBCondition
    @DBField
    public int BarCodeType = 0;

    /**
     * 多工单开工支持
     */
    @DBCondition
    @DBField
    public int IsMultiStartSupport = 0;

    /**
     * 是否取消组装检查
     */
    @DBField
    @DBCondition
    public int IsCancelAssemblyCheck = 0;

    /**
     * 是否点检检查
     */
    @DBField
    @DBCondition
    public int IsSpotCheck = 0;

    /**
     * 是否报工卡控
     */
    @DBCondition
    @DBField
    public int IsRepockCheck = 0;

    @JsonProperty("FactoryID")
    public int getFactoryID() {
        return FactoryID;
    }

    public void setFactoryID(int factoryID) {
        FactoryID = factoryID;
    }

    @JsonProperty("FactoryCode")
    public String getFactoryCode() {
        return FactoryCode;
    }

    public void setFactoryCode(String factoryCode) {
        FactoryCode = factoryCode;
    }

    @JsonProperty("FactoryName")
    public String getFactoryName() {
        return FactoryName;
    }

    public void setFactoryName(String factoryName) {
        FactoryName = factoryName;
    }

    @JsonProperty("WorkshopID")
    public int getWorkshopID() {
        return WorkshopID;
    }

    public void setWorkshopID(int workshopID) {
        WorkshopID = workshopID;
    }

    @JsonProperty("WorkshopName")
    public String getWorkshopName() {
        return WorkshopName;
    }

    public void setWorkshopName(String workshopName) {
        WorkshopName = workshopName;
    }

    @JsonProperty("WorkshopCode")
    public String getWorkshopCode() {
        return WorkshopCode;
    }

    public void setWorkshopCode(String workshopCode) {
        WorkshopCode = workshopCode;
    }


    @JsonProperty("WorkAreaID")
    public int getWorkAreaID() {
        return WorkAreaID;
    }

    public void setWorkAreaID(int workAreaID) {
        WorkAreaID = workAreaID;
    }

    @JsonProperty("WorkAreaName")
    public String getWorkAreaName() {
        return WorkAreaName;
    }

    public void setWorkAreaName(String workAreaName) {
        WorkAreaName = workAreaName;
    }

    @JsonProperty("WorkAreaCode")
    public String getWorkAreaCode() {
        return WorkAreaCode;
    }

    public void setWorkAreaCode(String workAreaCode) {
        WorkAreaCode = workAreaCode;
    }

    @JsonProperty("WorkName")
    public String getWorkName() {
        return WorkName;
    }

    public void setWorkName(String workName) {
        WorkName = workName;
    }


    @JsonProperty("Icon")
    public String getIcon() {
        return Icon;
    }

    public void setIcon(String icon) {
        Icon = icon;
    }


    @JsonProperty("ResourceList")
    public List<FMCResource> getResourceList() {
        return ResourceList;
    }

    public void setResourceList(List<FMCResource> resourceList) {
        ResourceList = resourceList;
    }

    @JsonProperty("DeviceID")
    public List<Integer> getDeviceID() {
        return DeviceID;
    }

    public void setDeviceID(List<Integer> deviceID) {
        DeviceID = deviceID;
    }

    @JsonProperty("DeviceName")
    public String getDeviceName() {
        return DeviceName;
    }

    public void setDeviceName(String deviceName) {
        DeviceName = deviceName;
    }

    @JsonProperty("DeviceCode")
    public String getDeviceCode() {
        return DeviceCode;
    }

    public void setDeviceCode(String deviceCode) {
        DeviceCode = deviceCode;
    }

    @JsonProperty("StoreID")
    public List<Integer> getStoreID() {
        return StoreID;
    }

    public void setStoreID(List<Integer> storeID) {
        StoreID = storeID;
    }

    @JsonProperty("StoreName")
    public String getStoreName() {
        return StoreName;
    }

    public void setStoreName(String storeName) {
        StoreName = storeName;
    }

    @JsonProperty("StoreCode")
    public String getStoreCode() {
        return StoreCode;
    }

    public void setStoreCode(String storeCode) {
        StoreCode = storeCode;
    }

    @JsonProperty("SequenceNo")
    public int getSequenceNo() {
        return SequenceNo;
    }

    public void setSequenceNo(int sequenceNo) {
        SequenceNo = sequenceNo;
    }

    @JsonProperty("CheckType")
    public int getCheckType() {
        return CheckType;
    }

    public void setCheckType(int checkType) {
        CheckType = checkType;
    }

    @JsonProperty("FunctionEnumList")
    public List<Integer> getFunctionEnumList() {
        return FunctionEnumList;
    }

    public void setFunctionEnumList(List<Integer> functionEnumList) {
        FunctionEnumList = functionEnumList;
    }

    @JsonProperty("Status")
    public int getStatus() {
        return Status;
    }

    public void setStatus(int status) {
        Status = status;
    }

    @JsonProperty("AlarmText")
    public String getAlarmText() {
        return AlarmText;
    }

    public void setAlarmText(String alarmText) {
        AlarmText = alarmText;
    }

    @JsonProperty("BarCodeType")
    public int getBarCodeType() {
        return BarCodeType;
    }

    public void setBarCodeType(int barCodeType) {
        BarCodeType = barCodeType;
    }

    @JsonProperty("IsMultiStartSupport")
    public int getIsMultiStartSupport() {
        return IsMultiStartSupport;
    }

    public void setIsMultiStartSupport(int isMultiStartSupport) {
        IsMultiStartSupport = isMultiStartSupport;
    }

    @JsonProperty("IsCancelAssemblyCheck")
    public int getIsCancelAssemblyCheck() {
        return IsCancelAssemblyCheck;
    }

    public void setIsCancelAssemblyCheck(int isCancelAssemblyCheck) {
        IsCancelAssemblyCheck = isCancelAssemblyCheck;
    }

    @JsonProperty("IsSpotCheck")
    public int getIsSpotCheck() {
        return IsSpotCheck;
    }

    public void setIsSpotCheck(int isSpotCheck) {
        IsSpotCheck = isSpotCheck;
    }

    @JsonProperty("IsRepockCheck")
    public int getIsRepockCheck() {
        return IsRepockCheck;
    }

    public void setIsRepockCheck(int isRepockCheck) {
        IsRepockCheck = isRepockCheck;
    }
}
